home *** CD-ROM | disk | FTP | other *** search
/ Aminet 4 / Aminet 4 - November 1994.iso / aminet / comm / term / vltj5867.lha / VLT / rexx / SendASCII.vlt < prev    next >
Text File  |  1994-03-27  |  1KB  |  70 lines

  1. /** SendASCII.vlt
  2. *
  3. *   VLT ASCII send test using xprascii.library. Note that these days it
  4. *   is easier to use the Paste facility.
  5. *
  6. **/
  7. /*
  8. *   Add libraries if necessary
  9. */
  10. if show("l", "rexxarplib.library") = 0 then do
  11.    check = addlib('rexxsupport.library', 0, -30, 0)
  12.    check = addlib('rexxarplib.library',  0, -30, 0)
  13. end
  14. /*
  15. *   The following sequence determines both VLT's screen and port name
  16. */
  17. vltport = address()
  18. cols = ScreenCols(vltport)
  19. if cols == -1 then vltscreen = ""
  20. else               vltscreen = vltport
  21. /*
  22. *   Get last file sent
  23. */
  24. filename = getenv(vltasciifilnam)
  25. dirname  = ""
  26. /*
  27. *   Break up into file and dir
  28. */
  29. nf = lastpos("/", filename)
  30.  
  31. if nf = 0 then do
  32.    nf = lastpos(":", filename)
  33.    if nf ~= 0 then do
  34.       dirname  = substr(filename, 1, nf)
  35.       filename = substr(filename, nf + 1)
  36.    end
  37. end
  38. else do
  39.    dirname  = substr(filename, 1, nf - 1)
  40.    filename = substr(filename, nf + 1)
  41. end
  42. /*
  43. *   Ask for file
  44. */
  45. filename = GetFile(50, 50, dirname, filename, "Enter File Name", vltscreen)
  46. if filename = "" then exit
  47. /*
  48. *   Save filename to env var.
  49. */
  50. call setenv(vltasciifilnam, filename)
  51. /*
  52. *   Find out the current settings
  53. */
  54. 'extract transferprotocol'
  55. 'extract currentxpr'
  56. /*
  57. *   Select current transfer protocol
  58. */
  59. 'xpr select xprascii.library'
  60. 'transfer protocol external'
  61. 'xpr init 50'
  62. 'file send 'filename
  63. /*
  64. *   Set protocol back to previous
  65. */
  66. 'xpr select 'VLT.currentxpr
  67. 'transfer protocol 'VLT.transferprotocol
  68. exit
  69.  
  70.